import request from '@/utils/request'
const wecom = window.lwConfig.services.weChat
const service = wecom + '/lxqr'

export function getPullNewsCode(data) {
  return request({
    url: service + '/getQrcode',
    method: 'post',
    data,
  })
}
// 领取红包或卡券
export function getPullNews(data) {
  return request({
    url: service + '/receive/award',
    method: 'post',
    data,
  })
}
/**
 * 获取红包封面信息 （公司名，logo）
 * @returns
 */
export function getRedPacketInfo() {
  return request({
    url: wecom + '/RedEnvelopes/findRedEnvelopesInfo',
  })
}
/**
 * 红包领取列表
 * @param {*}
 * @returns
 */
export function getReceiveList(data) {
  return request({
    url: service + '/getReceiveList',
    method: 'post',
    data,
  })
}
/**
 * 校验客户是否已领取过红包
 * @param {*}
{
  "orderNo": "1494182309006471169", // 订单id
  "openId": "76", // 客户公众号id
}
 * @returns 返回true的时候客户已领取过红包，false客户未领取红包
 */
export function getReceiveStatus(data) {
  return request({
    url: service + '/checkIsReceive',
    method: 'post',
    data,
  })
}
